package com.example.demo.controller;


import com.example.demo.common.Result;
import com.example.demo.entity.ParkingLot;
import com.example.demo.pojo.ParkingLotDTO;
import com.example.demo.pojo.ParkingLotVO;
import com.example.demo.service.ParkingLotService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/parking")
public class ParkingController {
    @Resource
    ParkingLotService parkingLotService;


    @PostMapping("")
    public Result selectParkingLot(@RequestBody ParkingLotDTO parkingLotDTO){
        List<ParkingLotVO> parkingLots = parkingLotService.selectVO(parkingLotDTO);
        if(parkingLots != null){
            return Result.success(parkingLots);
        }
        return Result.error("查询信息为空!");
    }
}
